package matcher;

import java.io.File;
import java.io.FileNotFoundException;
import java.util.Scanner;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class matcher {

	public static void main(String[] args) throws FileNotFoundException {
		Scanner sc = new Scanner(new File("C:/Users/usuario/Documents/2011-September.txt"));
		
		
		Pattern patron = Pattern.compile("[_A-Za-z0-9-]+(\\.[_A-Za-z0-9-]+)*@[A-Za-z0-9]+(\\.[A-Za-z0-9]+)*(\\.[A-Za-z]{2,})");
		
		int i = 1;
		while(sc.hasNextLine()){
		Matcher m = patron.matcher(sc.nextLine());
			
			while(m.find()){
				System.out.print(i+": ");
				System.out.println(m.group());
				i++;
			}
		}

	}

}

